﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Testpad.BTS;
using Kuge.AppSetting;

namespace BTS6000
{
    public partial class frmResetProbe : Form
    {
        public frmResetProbe()
        {
            InitializeComponent();
        }

        private void frmResetProbe_Load(object sender, EventArgs e)
        {
            this.Icon = Properties.Resources.Tools;
            numProbe.Value = INI.GetInt("AutoSave", "Probe", 50000);
        }

        private void btnReset_Click(object sender, EventArgs e)
        {
            if (Testpad.BTS.BTS6000.Instance == null)
            {
                MessageBox.Show(Program.MDI.SR.DeviceIsNotReady, Program.MDI.SR.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                //reset the probe counter
                Testpad.BTS.BTS6000.Instance.ResetProbeCounter((UInt32)numProbe.Value);
                INI.Set("AutoSave", "Probe", (int)numProbe.Value);
                this.Close();
            }
        }
    }
}
